$(function () {
    
	//getsffsh();
	getqysl();
	getcjdj();
    getcjlx();
    
    getsex();
	getcsrq();
	gethyzk();
	getwhcd();
    echart_1();
	function getsffsh(){
			 $.ajax({
					url : "/sys/clDisabledInfo/getsffsh",
					contentType : "application/json",
		         	dataType : 'json',
					data : JSON.stringify(),
		          	type:'post',
					success : function(data) {
						echart_1(data.data);
					
					}
				}); 
	}
	function getqysl(){
		 $.ajax({
				url : "/sys/clDisabledInfo/getqysl",
				contentType : "application/json",
	         	dataType : 'json',
				data : JSON.stringify(),
	          	type:'post',
				success : function(data) {
					
					
					 echart_2(data.data);
					 echart_map(data.data);
				
				}
			}); 
}
	function getcjdj(){
		 $.ajax({
				url : "/sys/clDisabledInfo/getcjdj",
				contentType : "application/json",
	         	dataType : 'json',
				data : JSON.stringify(),
	          	type:'post',
				success : function(data) {
					 echart_3(data.data);
				
				}
			}); 
}
	function getcjlx(){
		 $.ajax({
				url : "/sys/clDisabledInfo/getcjlx",
				contentType : "application/json",
	         	dataType : 'json',
				data : JSON.stringify(),
	          	type:'post',
				success : function(data) {
					 echart_8(data.data);
				
				}
			}); 
}
	function getsex(){
		 $.ajax({
				url : "/sys/clDisabledInfo/getsex",
				contentType : "application/json",
	         	dataType : 'json',
				data : JSON.stringify(),
	          	type:'post',
				success : function(data) {
					 echart_4(data.data);
				
				}
			}); 
}
	function getcsrq(){
		 $.ajax({
				url : "/sys/clDisabledInfo/getcsrq",
				contentType : "application/json",
	         	dataType : 'json',
				data : JSON.stringify(),
	          	type:'post',
	          	 async:false, 
				success : function(data) {
					var list=data.data;
					 echart_6(list);
				
				}
			}); 
}
	function getwhcd(){
		 $.ajax({
				url : "/sys/clDisabledInfo/getwhcd",
				contentType : "application/json",
	         	dataType : 'json',
				data : JSON.stringify(),
	          	type:'post',
				success : function(data) {
					var list=data.data;
					 echart_7(list);
				
				}
			}); 
}
	function gethyzk(){
		 $.ajax({
				url : "/sys/clDisabledInfo/gethyzk",
				contentType : "application/json",
	         	dataType : 'json',
				data : JSON.stringify(),
	          	type:'post',
				success : function(data) {
					var list=data.data;
					 echart_9(list);
				
				}
			}); 
}
    function echart_1(data) {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_1'));
        var app = {};
		var option;
		
	option = {
		tooltip: {
			trigger: 'item',
			formatter: ' {c} '
		},
		dataset: [{
			dimensions: ['name', 'score'],
			source: [
				['持证', 37396],
				['(0-3)非持证',1070],
				['军人', 1749],
				['警察',300]
			
			]
		}, {
			transform: {
				type: 'sort',
				config: { dimension: 'score', order: 'desc' }
				
			}
		}],
		grid:{
			left:'3%',
			containLabel:true
		},
		xAxis: {
			type: 'category',
		
			axisLine: {
					lineStyle: {
						color: "#333",
					}
				}
		},
		yAxis: {
			axisLine: {
					lineStyle: {
						color: "#333",
					}
				}
		},
		series: {
			type: 'bar',
			encode: { x: 'name', y: 'score' },
			barWidth : 30,//柱图宽度
			 itemStyle: {
						normal: {
							
						label:{
							show:true,
							position:'top',
							textStyle:{
								color:'	#0000FF',
								fontSize:16
							}
						},
			　　　　　　　　//这里是重点
							color: function(params) {
								//注意，如果颜色太少的话，后面颜色不会自动循环，最好多定义几个颜色
								var colorList = [ '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622','#c23531','#d48265'];
								return colorList[params.dataIndex]
							}
						}
					}
			
		}
	};

	if (option && typeof option === 'object') {
		myChart.setOption(option);
	}
    }

    //电子商务销售额、订单数
    function echart_2(list) {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_2'));
        var app = {};
		var option;
		var arr=[];
		var str=["福田区","罗湖区","南山区","盐田区","宝安区","龙岗区","光明区","坪山区","龙华区","大鹏新区"];
		for (var j = 0; j < str.length; j++) {
			 for(var i=0;i<list.length;i++){
				 if(list[i].name==str[j]){
				 arr.push([list[i].name,list[i].value])
				 }
			 }
		}
		
	option = {
		tooltip: {
			trigger: 'item',
			formatter: ' {c} '
		},
		dataset: [{
			dimensions: ['name', 'score'],
			source: arr
		}, {
			transform: {
				type: 'sort',
				config: { dimension: 'score', order: 'desc' }
			}
		}],
		grid:{
			left:'3%',
			bottom:"1%",
			containLabel:true
		},
		xAxis: {
			type: 'category',
			axisLabel: { interval: 0, rotate: 40 },
			axisLine: {
					lineStyle: {
						color: "#333",
					}
				}
		},
		yAxis: {
			axisLine: {
					lineStyle: {
						color: "#333",
					}
				}
		},
	
		series: {
			type: 'bar',
			encode: { x: 'name', y: 'score' },
			 itemStyle: {
						normal: {
			　　　　　　　label:{
							
							　//这里是重点
							color: function(params) {
								//注意，如果颜色太少的话，后面颜色不会自动循环，最好多定义几个颜色
								var colorList = [ '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622','#c23531','#d48265'];
								return colorList[params.dataIndex]
							}
						}
					}
			
		}
	}
	};
	if (option && typeof option === 'object') {
		myChart.setOption(option);
	}
    }

    // echart_map中国地图
    function echart_map(datas) {
        var myChart = echarts.init(document.getElementById('chart_map'));
        var list=[];
        for(var i=0;i<datas.length;i++){
        	if(datas[i].name=="光明区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        	if(datas[i].name=="宝安区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        	if(datas[i].name=="南山区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        	if(datas[i].name=="福田区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        	if(datas[i].name=="龙华区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        	if(datas[i].name=="龙岗区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        	if(datas[i].name=="罗湖区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        	if(datas[i].name=="盐田区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        	if(datas[i].name=="坪山区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        	if(datas[i].name=="大鹏新区"){
        		list.push({name:datas[i].name,value:[50,datas[i].value]})
        	}
        }
        function showProvince() {
            var geoCoordMap = {
                '光明区': [113.939085,22.756731],'宝安区': [113.872395,22.653245],'南山区': [113.935636,22.537395],'福田区': [114.062692,22.528315],'龙华区': [114.049469,22.701797],'龙岗区': [114.254714,22.724734],'罗湖区': [114.140306,22.554485],'盐田区': [114.256718,22.583165],'坪山区': [114.383199,22.704844],'大鹏新区': [114.500482,22.55433]
            };
            
            var data =list;
            var max = 480,
                min = 9;
            var maxSize4Pin = 50,
                minSize4Pin = 20;
            var convertData = function (data) {
                var res = [];
                for (var i = 0; i < data.length; i++) {
                    var geoCoord = geoCoordMap[data[i].name];
                    
                    if (geoCoord) {
                        res.push({
                            name: data[i].name,
                            value: geoCoord.concat(data[i].value),                            
                        });
                    }
                }
                return res;
            };

            myChart.setOption(option = {
                tooltip: {
                    trigger: 'item',
                    formatter: function loadData(result){
                        return result.name+'<br/>' +result.value[3];
                        
                    }
                    
                },
                
                geo: {
                    zoom:1.2, 
                    show: true,
                    map:'深圳',
                    mapType: '深圳',
                    label: {
                        normal: {
                            show : true,
                            textStyle:{color:"#4bf316"}
                        },
                        emphasis: {
                            show: true,
                            textStyle: {
                                color: '#333'
                            }
                        }, 
                    },
                    roam: false,
                    itemStyle: {                        
                        normal: {
                            borderColor: 'rgba(147, 235, 248, 1)',
                            borderWidth: 2,
                           
                           areaColor: {
                                type: 'radial',
                                x: 0.5,
                                y: 0.5,
                                r: 0.8,
                                colorStops: [{
                                    offset: 0,
                                    color: 'rgba(175,238,238, 0)', // 0% 处的颜色
                                   
                                }, {
                                    offset: 1,
                                    color: 'rgba(   47,79,79, .2)' // 100% 处的颜色
                                }],
                                globalCoord: false // 缺省为 false
                            },
                            shadowColor: 'rgba(128, 217, 248, 1)',
                            shadowOffsetX: -2,
                            shadowOffsetY: 2,
                            shadowBlur: 10
                        },
                        emphasis: {
                            areaColor: '#389BB7',
                            borderWidth: 0
                        }
                    },
                    regions: [      //对不同的区块进行着色
			            {
			              name: '光明区', //区块名称
			              itemStyle: {
			                  normal: {
			                      areaColor: '#F7F4DA'
			                  }
			              }
			            },{
			              name: '宝安区', //区块名称
			              itemStyle: {
			                  normal: {
			                      areaColor: '#F0A50D'
			                  }
			              }
			            },{
			              name: '南山区', //区块名称
			              itemStyle: {
			                  normal: {
			                      areaColor: '#FFCF00'
			                  }
			              }
			            },{
			              name: '龙华区', //区块名称
			              itemStyle: {
			                  normal: {
			                      areaColor: '#F7E3AC'
			                  }
			              }
			            },{
			              name: '福田区', //区块名称
			              itemStyle: {
			                  normal: {
			                      areaColor: '#FFCF00'
			                  }
			              }
			            },{
			              name: '龙岗区', //区块名称
			              itemStyle: {
			                  normal: {
			                      areaColor: '#FFD300'
			                  }
			              }
			            },{
			            name: '罗湖区',
			            itemStyle: {
			                normal: {
			                    areaColor: '#FFDEA6'
			                }
			            }
			        },{
			            name: '盐田区',
			            itemStyle: {
			                normal: {
			                    areaColor: '#F8F3DA'
			                }
			            }
			        },{
			            name: '坪山区',
			            itemStyle: {
			                normal: {
			                    areaColor: '#FAF2D9'
			                }
			            }
			        },{
			            name: '大鹏新区',
			            itemStyle: {
			                normal: {
			                    areaColor: '#F7F4DB'
			                }
			            }
			        }] 
                },
                series: [                    
                    {
                        name: '残疾人比例',
                        type: 'scatter',
                        coordinateSystem: 'geo',
                        symbol: 'pin',
                        symbolSize: function(val) {
                            var a = (maxSize4Pin - minSize4Pin) / (max - min);
                            var b = minSize4Pin - a * min;
                            b = maxSize4Pin - a * max;
                            return a * val[2] + b;
                        },
                        label: {
                        	
                        
                            normal: {
                               /* formatter: '',*/
                               formatter: function loadData(result){
                                    return result.name+" :  " +result.value[3];
                                	/*console.log(result);*/
                                    
                                },
                                show: true,
                                textStyle: {
                                    color: '#102b6a',
                                    fontSize: 10,
                                }
                            }
                        },
                       
                        	
                        itemStyle: {
                            normal: {
                                color: 'red', //标志颜色
                            }
                        },
                        zlevel: 6,
                        data: convertData(data),
                    },
                    {
                        type: 'effectScatter',
                        coordinateSystem: 'geo',
                        data: convertData(data.sort(function (a, b) {
                            return b.value - a.value;
                        }).slice(0, 47)),
                        symbolSize: function (val) {
                            return val[2] / 10;
                        },
                        showEffectOn: 'render',
                        rippleEffect: {
                            brushType: 'stroke'
                        },
                        hoverAnimation: true,
                        itemStyle: {
                            normal: {
                                color: '#05C3F9',
                                shadowBlur: 10,
                                shadowColor: '#05C3F9'
                            }
                        },
                        zlevel: 1
                    }
                    
                ]
            });
        }
        showProvince();
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }

    //echart_3货物周转量
    function echart_3(list) {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_3'));
        var app = {};
		var option;
		var arr=[];
		 for(var i=0;i<list.length;i++){
			 if(list[i].cjdjmc=="1"){
			 arr.push(["一级",list[i].sl])
			 }
		 	if(list[i].cjdjmc=="2"){
			 arr.push(["二级",list[i].sl])
			 }
	    	if(list[i].cjdjmc=="3"){
			 arr.push(["三级",list[i].sl])
			 }
			if(list[i].cjdjmc=="4"){
			 arr.push(["四级",list[i].sl])
			 }
		 }
	option = {
		tooltip: {
			trigger: 'item',
			formatter: ' {c} '
		},
		dataset: [{
			dimensions: ['name', 'score'],
			source: arr
		}, {
			transform: {
				type: 'sort',
				config: { dimension: 'score', order: 'desc' }
			}
		}],
		xAxis: {
			type: 'category',
			axisLabel: { interval: 0, rotate: 40 },
			axisLine: {
					lineStyle: {
						color: "#333",
					}
				}
		},
		yAxis: {
			axisLine: {
					lineStyle: {
						color: "#333",
					}
				}
		},
		grid:{
			left:'3%',
			bottom:"1%",
			containLabel:true
		},
		series: {
			type: 'bar',
			encode: { x: 'name', y: 'score' },
			barWidth : 30,//柱图宽度
			 itemStyle: {
			
				 normal: {
			　　　　　　
					 label:{
							show:true,
							position:'top',
							textStyle:{
								color:'	#0000FF',
								fontSize:16
							}
						},　
					 　//这里是重点
							color: function(params) {
								//注意，如果颜色太少的话，后面颜色不会自动循环，最好多定义几个颜色
								var colorList = [ '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622','#c23531','#d48265'];
								return colorList[params.dataIndex]
							}
						}
					}
			
		}
	};

	if (option && typeof option === 'object') {
		myChart.setOption(option);
	}
    }
	
	function echart_4(list) {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_4'));
    	var arr=[];
		 for(var i=0;i<list.length;i++){
			 if(list[i].SEX=="1"){
			 arr.push({value: list[i].sl, name: "男"});
			 }
		 	if(list[i].SEX=="2"){
			 arr.push({value: list[i].sl, name: "女"});
			 }
	    	
		 }
        var app = {};
		var option;
		option = {
				title: {
					text: '',
					subtext: '',
					left: 'center'
				},
				tooltip: {
					trigger: 'item',
					formatter: ' <br/>{b} : {c} ({d}%)'
				},
				legend: {
					bottom: 10,
					left: 'center',
					data: ['男', '女'],
					textStyle: {
								color: '#333',
							}
				},
				series: [
					{
						type: 'pie',
						radius: '65%',
						center: ['50%', '50%'],
						selectedMode: 'single',
						data:arr,
						itemStyle: {
						emphasis: {
							itemStyle: {
								shadowBlur: 10,
								shadowOffsetX: 0,
								shadowColor: 'rgba(144, 238 ,144, 0.5)'
							}
						},
						 normal: {
							    color: function(params) {
							            //自定义颜色
							            var colorList = [
							            '#DC143C', '#00BFFF', '#0000FF'
							            ];
							            return colorList[params.dataIndex]
							        }
							    }
						}
						
					}
				]
			};

	if (option && typeof option === 'object') {
		myChart.setOption(option);
	}
    }

    //湖南省飞机场
    function echart_5() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_5'));

        function showProvince() {
                var geoCoordMap = {
                    '长沙黄花国际机场': [113.226512,28.192929],
                    '张家界荷花机场': [110.454598,29.107223],
                    '常德桃花源机场': [111.651508,28.921516],
                    '永州零陵机场': [111.622869,26.340994],
                    '怀化芷江机场': [109.714784,27.44615],
                };
                var data = [{
                        name: '长沙黄花国际机场',
                        value: 100
                    },
                    {
                        name: '张家界荷花机场',
                        value: 100
                    },
                    {
                        name: '常德桃花源机场',
                        value: 100
                    },
                    {
                        name: '永州零陵机场',
                        value: 100
                    },
                    {
                        name: '怀化芷江机场',
                        value: 100
                    }
                ];
                var max = 480,
                    min = 9; // todo 
                var maxSize4Pin = 100,
                    minSize4Pin = 20;
                var convertData = function (data) {
                    var res = [];
                    for (var i = 0; i < data.length; i++) {
                        var geoCoord = geoCoordMap[data[i].name];
                        if (geoCoord) {
                            res.push({
                                name: data[i].name,
                                value: geoCoord.concat(data[i].value)
                            });
                        }
                    }
                    return res;
                };

                myChart.setOption(option = {
                    title: {
                        top: 20,
                        text: '',
                        subtext: '',
                        x: 'center',
                        textStyle: {
                            color: '#ccc'
                        }
                    },
                    legend: {
                        orient: 'vertical',
                        y: 'bottom',
                        x: 'right',
                        data: ['pm2.5'],
                        textStyle: {
                            color: '#333'
                        }
                    },
                    visualMap: {
                        show: false,
                        min: 0,
                        max: 500,
                        left: 'left',
                        top: 'bottom',
                        text: ['高', '低'], // 文本，默认为数值文本
                        calculable: true,
                        seriesIndex: [1],
                        inRange: {
                        }
                    },
                    geo: {
                        show: true,
                        map:'hunan',
                        mapType: 'hunan',
                        label: {
                            normal: {
                            },
                            //鼠标移入后查看效果
                            emphasis: {
                                textStyle: {
                                    color: '#fff'
                                }
                            }
                        },
                        //鼠标缩放和平移
                        roam: true,
                        itemStyle: {
                            normal: {
                                //          	color: '#ddd',
                                borderColor: 'rgba(147, 235, 248, 1)',
                                borderWidth: 1,
                                areaColor: {
                                    type: 'radial',
                                    x: 0.5,
                                    y: 0.5,
                                    r: 0.8,
                                    colorStops: [{
                                        offset: 0,
                                        color: 'rgba(175,238,238, 0)' // 0% 处的颜色
                                    }, {
                                        offset: 1,
                                        color: 'rgba(	47,79,79, .2)' // 100% 处的颜色
                                    }],
                                    globalCoord: false // 缺省为 false
                                },
                                shadowColor: 'rgba(128, 217, 248, 1)',
                                shadowOffsetX: -2,
                                shadowOffsetY: 2,
                                shadowBlur: 10
                            },
                            emphasis: {
                                areaColor: '#389BB7',
                                borderWidth: 0
                            }
                        }
                    },
                    series: [{
                            name: 'light',
                            type: 'map',
                            coordinateSystem: 'geo',
                            data: convertData(data),
                            itemStyle: {
                                normal: {
                                    color: '#F4E925'
                                }
                            }
                        },
                        {
                            name: '点',
                            type: 'scatter',
                            coordinateSystem: 'geo',
                            symbol: 'pin',
                            symbolSize: function(val) {
                                var a = (maxSize4Pin - minSize4Pin) / (max - min);
                                var b = minSize4Pin - a * min;
                                b = maxSize4Pin - a * max;
                                return a * val[2] + b;
                            },
                            label: {
                                normal: {
                                    // show: true,
                                    // textStyle: {
                                    //     color: '#fff',
                                    //     fontSize: 9,
                                    // }
                                }
                            },
                            itemStyle: {
                                normal: {
                                    color: '#F62157', //标志颜色
                                }
                            },
                            zlevel: 6,
                            data: convertData(data),
                        },
                        {  
                            name: 'light',
                            type: 'map',
                            mapType: 'hunan',
                            geoIndex: 0,
                            aspectScale: 0.75, //长宽比
                            showLegendSymbol: false, // 存在legend时显示
                            label: {
                                normal: {
                                    show: false
                                },
                                emphasis: {
                                    show: false,
                                    textStyle: {
                                        color: '#fff'
                                    }
                                }
                            },
                            roam: true,
                            itemStyle: {
                                normal: {
                                    areaColor: '#031525',
                                    borderColor: '#FFFFFF',
                                },
                                emphasis: {
                                    areaColor: '#2B91B7'
                                }
                            },
                            animation: false,
                            data: data
                        },
                        {
                            name: ' ',
                            type: 'effectScatter',
                            coordinateSystem: 'geo',
                            data: convertData(data.sort(function (a, b) {
                                return b.value - a.value;
                            }).slice(0, 5)),
                            symbolSize: function (val) {
                                return val[2] / 10;
                            },
                            showEffectOn: 'render',
                            rippleEffect: {
                                brushType: 'stroke'
                            },
                            hoverAnimation: true,
                            label: {
                                normal: {
                                    formatter: '{b}',
                                    position: 'right',
                                    show: true
                                }
                            },
                            itemStyle: {
                                normal: {
                                    color: '#05C3F9',
                                    shadowBlur: 10,
                                    shadowColor: '#05C3F9'
                                }
                            },
                            zlevel: 1
                        },

                    ]
                });
        }
        showProvince();

        // 使用刚指定的配置项和数据显示图表。
        // myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }
	
	function echart_6(list) {
       var myChart =  echarts.init(document.getElementById('chart_6'));

			var app = {};
			var arr=[];
			for (var i = 0; i < list.length; i++) {
				arr.push([list[i].name,list[i].value]);
			}
			var option;
		option = {
			tooltip: {
				trigger: 'item',
				formatter: ' {c} '
			},
			dataset: [{
				dimensions: ['name', 'score'],
				source: arr
			}, {
				transform: {
					type: 'sort',
					config: { dimension: 'score', order: 'desc' }
				}
			}],
			grid:{
				left:'3%',
				containLabel:true
			},
			xAxis: {
				type: 'category',
				axisLabel: { interval: 0, rotate: 30 },
				axisLine: {
						lineStyle: {
							color: "#333",
						}
					}
			},
			yAxis: {
				axisLine: {
						lineStyle: {
							color: "#333",
						}
					}
			},
			series: {
				type: 'bar',
				encode: { x: 'name', y: 'score' },
				 itemStyle: {
							normal: {
				　　　　　　　　//这里是重点
								color: function(params) {
									//注意，如果颜色太少的话，后面颜色不会自动循环，最好多定义几个颜色
									var colorList = ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622','#c23531','#d48265'];
									return colorList[params.dataIndex]
								}
							}
						}
				
			}
		};

		if (option && typeof option === 'object') {
			myChart.setOption(option);
		}

    }
	
		
		function echart_7(list) {
       var myChart =  echarts.init(document.getElementById('chart_7'));

			var app = {};
			var arr=[];
			for (var i = 0; i < list.length; i++) {
				if(list[i].whcd==1){
					list[i].whcd="文盲"
				}
				if(list[i].whcd==2){
					list[i].whcd="小学";
				}
				if(list[i].whcd==3){
					list[i].whcd="初中";
					}
				if(list[i].whcd==4){
					list[i].whcd="高中";
					}
				if(list[i].whcd==5){
					list[i].whcd="中专";
					}
				if(list[i].whcd==6){
					list[i].whcd="大专";
					}
				if(list[i].whcd==7){
					list[i].whcd="本科";
					}
				if(list[i].whcd==8){
					list[i].whcd="硕士";
					}
				if(list[i].whcd==9){
					list[i].whcd="博士";
					}
				if(list[i].whcd==10){
					list[i].whcd="其他";
				}
				arr.push([list[i].whcd,list[i].sl]);
			}
			var option;
		option = {
			tooltip: {
				trigger: 'item',
				formatter: ' {c} '
			},
			dataset: [{
				dimensions: ['name', 'score'],
				source: arr
				
				
			}, {
				transform: {
					type: 'sort',
					config: { dimension: 'score', order: 'desc' }
				}
			}],
			grid:{
				left:'3%',
				containLabel:true
			},
			xAxis: {
				type: 'category',
				axisLabel: { interval: 0, rotate: 30 },
				axisLine: {
						lineStyle: {
							color: "#333",
						}
					}
			},
			yAxis: {
				axisLine: {
						lineStyle: {
							color: "#333",
						}
					}
			},
			series: {
				type: 'bar',
				encode: { x: 'name', y: 'score' },
				 itemStyle: {
							normal: {
				　　　　　　　　//这里是重点
								color: function(params) {
									//注意，如果颜色太少的话，后面颜色不会自动循环，最好多定义几个颜色
									var colorList = ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622','#c23531','#d48265'];
									return colorList[params.dataIndex]
								}
							}
						}
				
			}
		};

		if (option && typeof option === 'object') {
			myChart.setOption(option);
		}

    }
	function echart_8(list) {
       var myChart =  echarts.init(document.getElementById('chart_8'));
   	var arr=[];
	 for(var i=0;i<list.length;i++){       
		 if(list[i].cjlxmc=="1"){
		 arr.push(["视力",list[i].sl])
		 }
	 	if(list[i].cjlxmc=="2"){
		 arr.push(["听力",list[i].sl])
		 }
   	if(list[i].cjlxmc=="3"){
		 arr.push(["言语",list[i].sl])
		 }
		if(list[i].cjlxmc=="4"){
		 arr.push(["肢体",list[i].sl])
		 }
		if(list[i].cjlxmc=="5"){
			 arr.push(["智力",list[i].sl ])
			 }
		if(list[i].cjlxmc=="6"){
			 arr.push(["精神",list[i].sl])
			 }
		if(list[i].cjlxmc=="7"){
			 arr.push(["多重",list[i].sl])
			 }
	 }
			var app = {};
			var option;
			option = {
				tooltip: {
					trigger: 'item',
					formatter: ' {c} '
				},
				dataset: [{
					dimensions: ['name', 'score'],
					source: arr
					
					
				}, {
					transform: {
						type: 'sort',
						config: { dimension: 'score', order: 'desc' }
					}
				}],
				grid:{
					left:'3%',
					containLabel:true
				},
				xAxis: {
					type: 'category',
					axisLabel: { interval: 0, rotate: 30 },
					axisLine: {
							lineStyle: {
								color: "#333",
							}
						}
				},
				yAxis: {
					axisLine: {
							lineStyle: {
								color: "#333",
							}
						}
				},
				series: {
					type: 'bar',
					encode: { x: 'name', y: 'score' },
					 itemStyle: {
								normal: {
					　　　　　　　　//这里是重点
									color: function(params) {
										//注意，如果颜色太少的话，后面颜色不会自动循环，最好多定义几个颜色
										var colorList = ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622','#c23531','#d48265'];
										return colorList[params.dataIndex]
									}
								}
							}
					
				}
			};

			if (option && typeof option === 'object') {
				myChart.setOption(option);
			}
    }
	
		function echart_9(list) {
       var myChart =  echarts.init(document.getElementById('chart_9'));

			var app = {};
			var option;
var arr=[];
for (var i = 0; i < list.length; i++) {
	if(list[i].hyzk==10){
		list[i].hyzk="未婚"
	}
	if(list[i].hyzk==20){
		list[i].hyzk="已婚";
	}
	if(list[i].hyzk==30){
		list[i].hyzk="丧偶";
		}
	if(list[i].hyzk==40){
		list[i].hyzk="离婚";
		}
	if(list[i].hyzk==90){
		list[i].hyzk="其他";
		}
	 arr.push({value: list[i].sl, name: list[i].hyzk});
}
console.log(arr);
		option = {
			title: {
				text: '',
				subtext: '',
				left: 'center'
			},
			tooltip: {
				trigger: 'item',
				formatter: ' <br/>{b} : {c} ({d}%)'
			},
			legend: {
				bottom: 10,
				left: 'center',
				data: ['已婚', '未婚', '离婚', '丧偶'],
				textStyle: {
							color: '#333',
						}
			},
			series: [
				{
					type: 'pie',
					radius: '65%',
					center: ['50%', '50%'],
					selectedMode: 'single',
					data:arr,
					emphasis: {
						itemStyle: {
							shadowBlur: 10,
							shadowOffsetX: 0,
							shadowColor: 'rgba(0, 0, 0, 0.5)'
						}
					}
				}
			]
		};

		if (option && typeof option === 'object') {
			myChart.setOption(option);
		}
    }
    //点击跳转
    // $('#chart_map').click(function(){
    //     window.location.href = './page/index.html';
    // });
    // $('.t_btn2').click(function(){
    //     window.location.href = "./page/index.html?id=2";
    // });
    // $('.t_btn3').click(function(){
    //     window.location.href = "./page/index.html?id=3";
    // });
    // $('.t_btn4').click(function(){
    //     window.location.href = "./page/index.html?id=4";
    // });
    // $('.t_btn5').click(function(){
    //     window.location.href = "./page/index.html?id=5";
    // });
    // $('.t_btn6').click(function(){
    //     window.location.href = "./page/index.html?id=6";
    // });
    // $('.t_btn7').click(function(){
    //     window.location.href = "./page/index.html?id=7";
    // });
    // $('.t_btn8').click(function(){
    //     window.location.href = "./page/index.html?id=8";
    // });
    // $('.t_btn9').click(function(){
    //     window.location.href = "./page/index.html?id=9";
    // });
});
